Hi,
I'm tyring to use substring to extract a the first 5 characters of a string variable, which I then plan to put in a second variable. My code mostly works, but every few tries it fails with the following message:
I've tried this by entering my substring text into the set variable value field, and by using Compose and using the substring in the Compose 2 Inputs field. in both cases it works sometimes, about 3 out of 5 time. and fails the rest of the time with the message above.
Here's what my variable and compose sections look like:
Can anyone point out what I am doing that is making it unstable?
Thanks much!
Solved! Go to Solution.
I got it sorted. I decided to try grabbing the department info from Office 365, rather than SharePoint. Now I have my initiator "When an item is created", I feed the Person Email I obtained from that (the URI) into the Office 365 Get User Profile (v2), then grab the Department from there.
Thank you so much for all the assistance!
I find there is a timing problem with the trigger that makes created information unreliable. I ususally use the modified information since it will be the same as created when a record is created. Modified and Modified by seem to be more reliable.
Are you accounting for the fact that people may not have a department list in their profile? If the string is less than 5 characters or null this is exactly the kind of message your will get.
Hi Pstork1,
No, I'm not. I'm not sure how to do that, any hints appreciated! I can see where that would cause the error; however, the people it is failing on do have an entry in that field, which is why it's confusing me so much. The field is a People Department field which looks like "12345 - Name of Department". All numeric entries are 5 digit followed by a space, dash, space, text.
Have you looked at a run that errored out to see what is in Vartrim? If you expand the actions in the run you can see inputs and outputs. That might help figure out why they are causing an error.
Thank you for the pointer of where to look. I hadn't looked at the flow above the error.
How interesting! I ran the flow for the same person mutliple times. When I get the error, the "Person" field in the initiating "When an item is created" section is coming back with the Department and JobTitle = null. When I rerun it for the same name and it works, the Department and JobTitle contain values.
Working:
I got it sorted. I decided to try grabbing the department info from Office 365, rather than SharePoint. Now I have my initiator "When an item is created", I feed the Person Email I obtained from that (the URI) into the Office 365 Get User Profile (v2), then grab the Department from there.
Thank you so much for all the assistance!
I find there is a timing problem with the trigger that makes created information unreliable. I ususally use the modified information since it will be the same as created when a record is created. Modified and Modified by seem to be more reliable.
User | Count |
---|---|
94 | |
47 | |
21 | |
19 | |
17 |
User | Count |
---|---|
143 | |
53 | |
42 | |
40 | |
31 |