cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
zeuslyone
Microsoft
Microsoft

Using mid and find with addcolumns to parse information

Hello,

I'm trying to create a column in a data table that will parse a substring from another column's string value, so I'm using AddColumns and Mid with a couple Find functions added to do this. I've done this kind of thing many times in Excel and Power BI, but I'm hitting a wall in trying to do it here. 

Here's my code:
AddColumns('Project Dashboard Creation (Test)', "Action", Mid(Description_Column1.Text, Find("Action:", Description_Column1.Text), (Find("Result:", Description_Column1.Text) - Find("Action", Description_Column1.Text))))

My test table is pulled from a SharePoint list with one test entry. The value in the field that should be parsed is (note -- editted out a couple html tags that shouldn't matter for this exercise but were breaking the post): 
Testing Flow with Azure DevOps and SharePoint ListTime to Test The Description!!! Action: Capture these words of wisdom Result: Success/Failure???

The mid function in the AddColumns then looks for that "Action:" in the Description column and should return the value from there to "Result:". However, when I do this, despite getting no error messages about the syntax, I get no return value, just a blank box.

Does anyone have any insight about what I'm doing wrong here? I'm pretty new to PowerApps, so I'm sure I'm misunderstanding something about how these functions are utilized.

Thanks for any help!
Z

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @zeuslyone ,

Do you want to extract the sub text string value from the Description column in your SP list?

 

Based on the formula you provided, I think there is something wrong with it. I have made a test on my side, please consider modify your formula as below (set the Items property of the Data table to following😞

AddColumns(
'Project Dashboard Creation (Test)',
"Action",
Mid(
Description, /* <-- Please type Description column (from your SP List) here rather than the column name value in your Data Table (e.g. Description_Column1.Text)*/
Find("Action:", Description),
Find("Result:", Description) - Find("Action", Description)
)
)

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
RezaDorrani
Dual Super User II
Dual Super User II

Hi @zeuslyone 

 

Try this

 

AddColumns('Project Dashboard Creation (Test)', "Action", Mid(Description_Column1, Find("Action:", Description_Column1), (Find("Result:", Description_Column1) - Find("Action", Description_Column1))))

 

Description_Column1 - is the name of the column which contains the value

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

v-xida-msft
Community Support
Community Support

Hi @zeuslyone ,

Do you want to extract the sub text string value from the Description column in your SP list?

 

Based on the formula you provided, I think there is something wrong with it. I have made a test on my side, please consider modify your formula as below (set the Items property of the Data table to following😞

AddColumns(
'Project Dashboard Creation (Test)',
"Action",
Mid(
Description, /* <-- Please type Description column (from your SP List) here rather than the column name value in your Data Table (e.g. Description_Column1.Text)*/
Find("Action:", Description),
Find("Result:", Description) - Find("Action", Description)
)
)

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you, @v-xida-msft ! That did the trick!!! Could you possibly explain why Description is different than the column name option? That would be helpful for my understanding.

Thank you @RezaDorrani ! It didn't solve the issue, but I appreciate the help.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,101)