Get items by Query

by bladec59 » Mon Mar 20, 2017 10:52 pm

Am unable to get this action to work when a filter is included. Keep getting an 'Exception: Error in requesting the Service' error and the workflow terminates. Am using in a site workflow, and action works fine without any filter at all. Am using syntax as in many examples on your site...see attached.
Attachments
plumsail.png
plumsail.png (51.13 KiB) Viewed 428 times
bladec59
 
Posts: 12
Joined: Thu Jun 04, 2015 6:31 pm

by Evgeniy Kovalev » Tue Mar 21, 2017 11:19 am

Hi bladec59,
Thank you for a message.

Please clarify, what the type of "Cycle" field?

And also, please try to call the server from your browser. For that, enter the link below in the browser address bar and replace tokens {The address of your Sharepoint site or site collection} and {Name of your list} on your data:

https://{The address of your Sharepoint site or site collection}/_vti_bin/listdata.svc/{Name of your list}?$top=&$skip=&$select=Cycle,Employee&$filter=startswith(Cycle, 'Dec')&$orderby=&$expand=

The result of this call will be an XML structure with descriptions of elements in your list or the error message.

Best regards
Evgeniy Kovalev
Plumsail Team
User avatar
Evgeniy Kovalev
 
Posts: 58
Joined: Wed Jul 20, 2016 2:13 pm

by bladec59 » Tue Mar 21, 2017 1:26 pm

Thanks for the quick reply. The 'Cycle' field is a choice field with 3 potential values. Employee, by the way is a SPUser field.

I tried the url but with no luck; getting 404 errors. Here is the actual url I used (with abc1234 substituted for real org name):

https://abc1234.sharepoint.com/HR/_vti_ ... with(Cycle, 'Dec')&$orderby=&$expand=
bladec59
 
Posts: 12
Joined: Thu Jun 04, 2015 6:31 pm

by Evgeniy Kovalev » Tue Mar 21, 2017 4:42 pm

If you trying to execute filtration based on "Choice" field, you need to add this field in "Expand" section and use a different expression for filtration. In your case it will be like in the example below:

GetItemsWithChoice.png
GetItemsWithChoice.png (35.14 KiB) Viewed 419 times

Best regards
Evgeniy Kovalev
Plumsail Team
User avatar
Evgeniy Kovalev
 
Posts: 58
Joined: Wed Jul 20, 2016 2:13 pm

by bladec59 » Tue Mar 21, 2017 5:39 pm

Thanks, that works. Is it possible to use a variable in the filter equation? Such as startswith(CycleValue,[%Variable:EmplCycle%])?? Where EmplCycle is a string variable?
bladec59
 
Posts: 12
Joined: Thu Jun 04, 2015 6:31 pm

by Evgeniy Kovalev » Wed Mar 22, 2017 9:59 am

Yes, you may use the string variable in the expression:
startswith(CycleValue,'[%Variable:EmplCycle%]')

Best regards
Evgeniy Kovalev
Plumsail Team
User avatar
Evgeniy Kovalev
 
Posts: 58
Joined: Wed Jul 20, 2016 2:13 pm


Return to Workflow Actions Pack for Office 365

cron