Jump to content
Sign in to follow this  
H

Seting a field with variable when importing from excel file

Recommended Posts

Hi

i want to create a script where i can import new records via excel . i want to be able to pick up the related parent table id and place it in the designated field in the imported sub file.

The PropertyIDF (see pic below) should get from parent table. see script below , unfortunately when i do the import it only places the propertyIDF for the first record in the foundset (see pic 2,) how do i script that all new records created should get the variable data in the selected field.   i would appreciate if one could help me out on this.

image.png.bcc477c919cb79269f873362c8f13b81.png 

 

image.png.e7dd81c957c5fd436499e4f80300aa7c.png

image.png.362efc2d44ef31ce6e693898c82b4cb6.png

image.png.30bf6ed153d9b90d533b523631059b49.png 

Share this post


Link to post
Share on other sites

I think you can give the field an auto entry calculation (define  field options) so you wouldn’t need the script. Sorry if this is wrong but I cant test atm. 

Share this post


Link to post
Share on other sites

Instead of 'Set Field' you could use the 'Replace Field Contents' script step, which would have the effect of putting the same value in the same field on the whole found set.

After an import, the found set is always the records that have just been imported.

Share this post


Link to post
Share on other sites

Both methods above will work. The auto-entry option will be faster if you're importing a lot of records (say, over 1000) but that also depends on your network. If that's not an issue, I'd lean towards the Replace method because where possible, I prefer to keep my logic in scripts rather than the field entry options.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.