Hey Everyone,
is it possible to nest string expressions?
I have one which I just seem to not be able to validate, They both work on there own, but when I try to nest them I can't get it to work.
Data: ["Alternative","Hip Hop","Rock"]
Expression 1: indexOf(outputs('Get_response_details')?['body/rf9d051bd49dd444fb731f2a2e4db56bc'],'Hip Hop')
(Looking to find the starting Index of the key word)
substring(outputs('Get_response_details')?['body/rf9d051bd49dd444fb731f2a2e4db56bc'],16,7)
(Get the word Hip Hop)
Nested expression that I want to create:
substring(outputs('Get_response_details')?['body/rf9d051bd49dd444fb731f2a2e4db56bc'],(indexOf(outputs('Get_response_details')?['body/rf9d051bd49dd444fb731f2a2e4db56bc'],'Hip Hop')),7)
I have many variables that I need to extract and present as clean text so ideally having a single function to perform both tasks would be great but not sure if its possible or just a syntax error,
Solved! Go to Solution.
Ah okay, I'm glad I asked -- let's do this instead:
Step 1) Compose action, cram this in there - the part I've made bold-orange is the only part you need to modify, which is just the Dynamic Content for your Genre Question from the form.
I answer questions on the forum for 2-3 hours every Thursday!
Hi there,
I think it's possible, but I might also be missing the point of this.
If you know the word you're looking for, and there's a match, why are you trying to extract it? You already know the word is hip hop, because you found the index of it, so I don't know why the second step is needed.
(I also know this really has nothing to do with your question, but I'm super curious on the need in this case.)
R
I answer questions on the forum for 2-3 hours every Thursday!
Hey @Rhiassuring!
Big picture I have a public facing MSform which I I need to end up in a Microsoft list.
(I work for a youth music NFP and we are creating a simple database of young artists to help them get gigs)
The issue I'm having is the check boxes from the form come in as a comma separated list e.g ["Alternative","Hip Hop","Rock"] and I need them as individual values to create the sharpoint item.
My solution has been to create a variable per check box and then use a search and extract to get the correct string without any additional characters, so for example this is the variable for the gene Hip Hop.
My original question was hoping to reduce the amount of components by combining the Find text position with the substring action to reduce the amount of components. The way I have it working is very long with 5 actions per variable.
Ah okay, I'm glad I asked -- let's do this instead:
Step 1) Compose action, cram this in there - the part I've made bold-orange is the only part you need to modify, which is just the Dynamic Content for your Genre Question from the form.
I answer questions on the forum for 2-3 hours every Thursday!
Rhia! You truly are the Resident Rockstar! 🎸
That is going to be sooo much cleaner and easier than the dumpster fire I made in lieu of your great advice!
thanks so much!
I answer questions on the forum for 2-3 hours every Thursday!
Hey @Rhiassuring one little follow up question .
When the select function is provided a single result, it complains about the lack of array?
Any pointers?/ideas
Hmm.. I just tested with a single value, and I don't get that error. My flow looks like this:
Does yours differ anywhere? Let's track down the issue..
I answer questions on the forum for 2-3 hours every Thursday!
Fun fact - I'm a dumb dumb and didn't follow you instructions as closely as I should.
EVERYTHING IS WORKING GREAT! Thanks Again,