cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Responsive Resident
Responsive Resident

SharePoint filter query and compose output

Hi Community,
I need to apply a filter query based on dynamic content but I am noticing some odd behavior with the compose output. I'n hoping someone can help.

This is my filter query which was working fine for mail but problems arise when I added an additional filter.

 

FilterQuery.JPG

The filter query works fine when I manually type the string BUT the output from compose looks identical. Although the output seems to push the last ' out when I look at the 'Get Items' action after a run.

Example of ' push out.

PPUS.JPG

Any ideas?

10 REPLIES 10
Highlighted
Dual Super User III
Dual Super User III

Re: SharePoint filter query and compose output

Hi!

It looks you have a 'new line' character in your Compose output, right?

If you want to remove it my suggestion is to replace its output from the ODATA expression and the following expression instead

replace(outputs('Compose'),'
','')

When writing the expression, just hit enter

 

Plase note I am assuming that the name of your Compose action block is 'Compose'

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Responsive Resident
Responsive Resident

Re: SharePoint filter query and compose output

Thanks for your reply.

It does look like it's putting a new line character in and that's why I've tried to use compose. I'm actually passing a Forms response in via compose but I don't see anything that would obviously cause a new line. It's a choice field from Forms.

I tried to use your expression in the ODATA query but the flow failed and then I tried to add an additional compose to use the expression and the result was the same. 

I've re-checked my Forms choices and there isn't any spaces in the choice at all. When I pass it through compose, the output is PPUS. Really confusing..

Highlighted
Dual Super User III
Dual Super User III

Re: SharePoint filter query and compose output

Hi again!

Some connectors have ODATA format restrictions.. which Connector and Action block are you using? Sharepoint 'Get items'? Excel 'List rows present in a table'? Other?

Did you also consider moving your filter logic into a 'Filter array' action block? A bot worse performance, but much much easier to define and with less restrictions

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Responsive Resident
Responsive Resident

Re: SharePoint filter query and compose output

Hi @efialttes ,

I am using the SharePoint 'Get Items' action in this case. I've passed compose outputs via this connector for  things like today's date and other values before. It seemed to work well.

I've not tried the Filter Array option as I've not got much experience with that and not sure how to approach it to be honest.

Here is my whole Flow

FullFlow.JPG

Highlighted
Responsive Resident
Responsive Resident

Re: SharePoint filter query and compose output

Any other ideas?

Highlighted
Dual Super User III
Dual Super User III

Re: SharePoint filter query and compose output

Hi again!

So I believe the problem is ... 'Get items' output is empty, right?

JUst guessing... Is 'Org' sharepoint field of type 'Single line of Text'? Or... Choice? Or Lookup?

So, if your field is a Lookup, you need to declare it in a different way:

Lookup Columns are supported in Filter Query – you can search by ID of the item in the lookup column. There is a special syntax that works:
[Lookup Column Internal Name]/Id eq ‘[ID Column]’.

Examples:
MainTraining/Id eq ‘@{triggerBody()?[‘Id’]}’
MainTraining/Id eq ‘@{body(‘Get_Main_Training_Event’)?[‘ID’]}’
Training/Id eq ‘@{triggerBody()?[‘Training’]?[‘Id’]}’

...as explained in one of the comments posted in this blog entry:
https://www.chakkaradeep.com/2018/05/01/deep-dive-into-get-items-and-get-files-sharepoint-actions-in-microsoft-flow/

 

If this is not the problem... can you also share a screenshot from your Compose action block result (by going to Run History, select any of the flow executions)?

Thanx!

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Responsive Resident
Responsive Resident

Re: SharePoint filter query and compose output

Hey @efialttes 
Thanks again for your response.
The Org field is a choice column. And correct, the Get Items runs successfully but doesn't return anything.

Here is the Output of the compose action and this is what I am passing into the ODATA query

Compose.JPG

Highlighted
Responsive Resident
Responsive Resident

Re: SharePoint filter query and compose output

I tried to create a new flow to test it out with pulling back Org only. In this failure, it looks like the compose action is actually passing through a linebreak!

LineBreak.JPG

Highlighted
Responsive Resident
Responsive Resident

Re: SharePoint filter query and compose output

Issue resolved. I passed the output from compose in via the 'convert html to text' action and then used the output of that in my ODATA query. Bizarre! 
Thanks again.

Highlighted
Dual Super User III
Dual Super User III

Re: SharePoint filter query and compose output

Hi again

And you already tried to add a second Compose to remove the new line, by adding the following expression, right?

replace(outputs('Compose'),'
','')

Then assign this second compose to build your ODATA expression

Please note the way to add expressions is by means of the dynamic content menu, as explained here

https://flow.microsoft.com/es-es/blog/use-expressions-in-actions/

 

Please try again this approach and share a scerenshot with the ODATA filter result during execution (as the one you shared in your last post)

Thanx!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
secondImage

August 2020 CYST Winners!

Check out the winners of the recent 'Can You Solve These?' community challenge!

thirdImage

Experience what's new for Power Automate

Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Users online (3,624)