Home › Forums › Modern DFFS › Set Value action for People or group field type
- This topic has 11 replies, 2 voices, and was last updated 1 week, 5 days ago by Amal Vellappillil.
-
AuthorPosts
-
-
November 6, 2024 at 23:04 #38233
Hi, I am trying to use the Set Field Value action available in the rules to set the value of a Person or Group (multi value) field. The rule is getting data from field1 and setting value in field2. When I type in the first person’s name and select that person, field2 value gets populated as expected. When I type in a second person’s name and select that person, field2 does not get updated. I see an error in dev console:
https://xxxx.sharepoint.com/sites/Intranet/_api/web/siteUsers/getByEmail(‘%20xxxxx@xxxx’) 404 (Not Found)As you can see there is a %20 in front of the actual email address and because of that user is not found. So this seems like a bug. Can you look into this?
I also tried to use the setFieldValue function, but that didnt work either. With this there were no errors in dev console. I tried different ways to use this function from js.
– setFieldValue(‘field2’, getFieldValue(‘field1’); <– this didnt work at all.
– I tried using a for loop to iterate over values from ‘field1’ and tried setFieldValue(‘field2’, values[i].email). <– this updated field2 with the first person from field1, but second person was not brought over.
How do you use this setFieldValue function in this case? -
November 6, 2024 at 23:07 #38234
I dont know why there is a ’ at the end of the url, but the actual url is as follows:
https://xxxx.sharepoint.com/sites/Intranet/_api/web/siteUsers/getByEmail(‘%20xxxxx@xxxx’) -
November 7, 2024 at 21:27 #38241
Are both Field1 and Field2 multichoice? Can you email me a screenshot of the rule you use to set the values?
Alexander
-
November 7, 2024 at 21:47 #38242
No need to send anything – I found the problem and will fix it in the next release (probably sometime next week).
Alexander
-
November 15, 2024 at 16:24 #38297
Hey Alex, any update on when the next update will be available with these fixes?
-
November 15, 2024 at 16:26 #38298
I have a few other issues left before I can release the next version, but hope to get it done during the weekend.
Alexander
-
November 15, 2024 at 16:52 #38299
Ok, thank you for the update.
-
November 20, 2024 at 17:16 #38315
Hi Alex,
I see that a fix was provided for this issue in version 1.0.73. However, I feel like its only partially fixed. Here is the behavior I am seeing:
– Field1 is people picker field, Field2 is people picker field.
– Rule set field value (field1 is changed set the value in field2 from field1)
– When people are added to field1, they are getting added to field2
– When people are removed from field1, they are not removed from field2 (this feels like a bug)
– Only when everyone has been removed from field1, everyone gets removed from field2Right now I am getting around this by running two set field value actions in the rule.
– First set field2 to blank
– Then set field2 to field1 values.Thank you for all your work on this and I hope a fix will be issued in the next release, so the feature works in the most natural form than going through work arounds.
-
November 20, 2024 at 23:35 #38317
Hi,
Are both of your people picker fields multichoice?Alexander
-
November 21, 2024 at 16:30 #38318
Yes they are both people picker fields with multichoice.
-
November 21, 2024 at 19:37 #38324
I have added a new option “Clear the previous value before setting new value” to the Set field value action in the rule-builder.
Alexander
-
November 21, 2024 at 20:48 #38326
Thank you so much, this is working as expected now.
-
-
AuthorPosts
- You must be logged in to reply to this topic.