Hi, I’m having some issues to update the object class value on import. I have object class X which has a reference to object class Y & object class Z. Object class Y also has a reference to object class Z. The import file does not contain any information of object class z. I,m trying to update the value of object class Z through object class y before persisting the file but that is not working.
But if I persist the data & try to update the value of object class Z then values are updated.
Is there a way i can update values on import?
Hi! I assume that your file contains the value of object class Y? When importing an object class value as a object reference you need to add a runtime only property to your data source X temp, which might be Y temp. Then map the Y column of your file to Y temp. Add an Update Object after your Import Data action node, to set the reference to Y. You can use update all objects in X temp and you have to use a function on the reference to Y for this: Add Y (which contains all Ys) as a Parameter and set a filter where X temp.Y = Y.(the value you would like to import) and return Y._id. Hope this will help
Yes, file contains value of object class y. I’m doing the same thing and it work.
I need help with updating the object class Z (file does not contain any information of object class Z). Object class Z has a reference to object class Y. I want to update the value of object class Z on import through object class Y. Can I do that?
Right now i’m updating the value of object class Z after persisting the file & it works perfectly. But I wanted to update the object class value before persisting the imported file.
Could you share a screenshot of how your action is set up?
Here is the action.
I want to update the license information before persist action node. License don’t have a direct connection with the platform (import file) but Field do have. So trying to update the license information from field data on import.
The action in the screenshot is updating the license information but after persisting the file.
I hope that makes it a bit clear now.
Based on the screenshot, it seems as you are updating the platform objects, and setting the reference to Field correctly (before the persist).
Moving to your next question. At this point (before the persist) you have a datasource with correct references to corresponding field. I guess the problem is that you want update all platforms, setting the property platform.license = platform.field.license?
If that’s the case, add a new Update Objects (of
platform (import)), setting
platform.license the following way using the Function editor:
license as Function parameter, by adding that data source and filter it by
license.id = platform(import).license.
if (license.length>0) return license.field
Hope that helps!
Thanks @kristian, I’ll try that.