cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
martinav
Community Champion
Community Champion

OData syntax for sharepoint column with a space - Get Items action.

I really am not thrilled that I have to learn an entirely different language to do filters in Flow.  But, that is what we have to live with, so I have to bother everyone with how to do this.

 

My Sharepoint column has a space in it.  How do you format the filter statement with a space in a column name.  I have tried these methods without success.

 

Part Number eq DVPartNumber

'Part Number' eq DVPartNumber

Part_x0020_Number eq DVPartNumber

 

Its hard to believe there are yet other ways to do this.  I need to know the right way.

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @martinav,

 

Please try to enter the following code:

Part_x0020_Number eq ‘DynamicContentColumnName’

 

If you are trying to use a dynamic content in the code, please surround it with a single quote.

 

Please try it on your side.

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
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

martinav
Community Champion
Community Champion

I have learned with further experience that the single quotes are required for text columns, and no quotes are required for number columns.  

View solution in original post

12 REPLIES 12
martinav
Community Champion
Community Champion

This is now urgent.  I hope for some help on this asap.  How to write this filter to account for a space in the column name.  I have way too much on this sharepoint list to change the name of the column.  I need the answer on how to include the space.  Please advise!!!image.png

martinav
Community Champion
Community Champion

Of course, my band aid to make another column, calculated to contain the information of the other did not work either.  Flow does not like the calculated type.  HELP!!!

 

Thank you.

martinav
Community Champion
Community Champion

More failed attempts... HELP!!!!

 

PartNumber eq DVPartNumber "Column 'PartNumber' does not exist. It may have been deleted by another user."
'Part Number' eq DVPartNumber "Column 'T900004' does not exist. It may have been deleted by another user.
Part_x0020_Number eq DVPartNumber "Column 'T900004' does not exist. It may have been deleted by another user."
Part_Number eq DVPartNumber "Column 'Part_Number' does not exist. It may have been deleted by another user."
{'Part Number'} eq DVPartNumber
{'Part_x0020_Number'} eq DVPartNumber
{Part Number} eq DVPartNumber "The $filter expression \"{Part Number} eq T900004 and Rev eq 3\" is not valid."
{Part_x0020_Number} eq DVPartNumber "The $filter expression \"[Part_Number] eq T900004 and Rev eq 3\" is not valid."
['Part_Number'] eq DVPartNumber "The $filter expression \"['Part_Number'] eq T900004 and Rev eq 3\" is not valid."
[Part_Number] eq DVPartNumber "The $filter expression \"['Part_Number'] eq T900004 and Rev eq 3\" is not valid."
[Part Number] eq DVPartNumber "The $filter expression \"['Part_Number'] eq T900004 and Rev eq 3\" is not valid."

Hi @martinav,

 

Please try to enter the following code:

Part_x0020_Number eq ‘DynamicContentColumnName’

 

If you are trying to use a dynamic content in the code, please surround it with a single quote.

 

Please try it on your side.

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
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

Thank you so much.  That did work.  The nuacne of syntax is overwhelming.  I do not even know how to define what dynamic content is.  It is still a matter of trial and error.  The next column used in my statement, Rev, requires no quote.  This is my resulting statement that works.  

 

image.png

martinav
Community Champion
Community Champion

I have learned with further experience that the single quotes are required for text columns, and no quotes are required for number columns.  

View solution in original post

End Date ne null

 

How to rewrite it

martinav
Community Champion
Community Champion

@casparLi ,

 

I'm not quite following your question.  if this is a sharpoint column named End Date, then use End_x0020_Date.  Null good as-is.  That turns into this:

 

End_x0020_Date ne null

 

I just created an account specifically to thank you. This issue was a giant time sink and your post helped me solve it. To sum it up:

If the SharePoint Online column name has a space in it, then the space must be substituted with _x0020_
If what the column name is being compared to is a string, then it must be wrapped in single quotes, regardless of whether it's a hardcoded value, a variable, dynamic content, or an expression

martinav
Community Champion
Community Champion

@WillNow ,

 

I'm so glad it did.  Yea, I have eliminated using spaces for anything.  I now use sharepoint column names like EndDate or End_Date.  Never a space.

 

I also found that renaming a sharepoint column is very problematic.  The internal column name stays the same.  This is a huge pain in the rear.  If its in development, its better to delete the column and re-create it.  I know thats not an option if its an established list, etc.  

 

I have found the power platform forums to be absolutely ESSENTIAL!  So much is undocumented, or is documented in a way that does not lend itself to practical application.  Forums provide that context.

 

Good luck!

 

Rod

Anonymous
Not applicable

For me, the field "Source ID" worked when I used SourceID as shown below:

ID eq SourceID

 

andrewsimmans
Advocate II
Advocate II

I have found where you can determine the correct syntax for the field name which has spaces. In Sharepoint, go to the List Settings and open the field you want to use. If you look at the URL at the end it has "&Field=Field_x0020_with_x0020_Sp" where "Field_x0020_with_x0020_Sp" is the field name for use in Odata queries!

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,219)