Skip to main content
Best Answer

Batch User Import Branch Code and Path Structure

  • August 12, 2025
  • 3 replies
  • 111 views

Hello,

After reading through the documentation I am still having an issue getting the correct branch code and name path setup in my import.

My branch structure is simple:

/Main Branch/Branch 1/Branch 1a

I want to bring users into Branch 1 and then create new branches under Branch 1.

/Main Branch/Branch 1/Branch 1a 

/Main Branch/Branch 1/Branch 1b (newly created branch)

/Main Branch/Branch 1/Branch 1c (newly created branch)

I have confirmed the Branch Code for Main Branch = 0 and Branch 1 = 1

My request looks like this, where Branch 1b does not exist yet

...
          Branch code path: “0/1/”,
          Branch name path: “Main Branch/Branch 1/Branch 1b”        }
      ],
      Options: 
{
        Change user password: false,
        Ignore password change for existing users: true,
        Power user option: “no_association”,
        Send notification email: false,
        Branch option: “existing”,
        Destination branch: 1,
        Update user info: true,
        Force create branches: true
      }



I can’t get it to create new branches for me. Can anyone point out what I’m doing wrong here?

Thank you so much in advance.
 

Best answer by avecchi

Just FYI for anyone else who finds this:

I was using the branch_id field, so in my case it was 0 and 1 for Main Branch and Sub-Branch. Once I assigned them branch codes and then used the branch codes instead of the branch_id everything worked.

3 replies

dwilburn
Guide III
Forum|alt.badge.img+4
  • Guide III
  • August 12, 2025

Hi ​@avecchi - this post deals with it from a CSV perspective. Maybe it will help.

 


  • Author
  • Newcomer
  • Answer
  • August 12, 2025

Just FYI for anyone else who finds this:

I was using the branch_id field, so in my case it was 0 and 1 for Main Branch and Sub-Branch. Once I assigned them branch codes and then used the branch codes instead of the branch_id everything worked.


  • Author
  • Newcomer
  • August 13, 2025

Coming back to report on another issue I had with batch importing users and creating new branches:

Some of my values for the datapill had "/" in them, like "Warehouse / Logistics", so it would create the branch "Warehouse" with the subbranch "Logistics"

The solution was to add this after the datapill:

.to_s.gsub(“/”, “ & ”)

So now I get a branch named "Warehouse & Logistics"

I could not for the life of me escape that "/" from the output so the API didn't read it as a delimiter.