web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Fetching items failed....
Power Apps
Answered

Fetching items failed. Possible invalid string in filter query

(0) ShareShare
ReportReport
Posted on by 4
Hi please see my below code where I am trying to generate one row for each Control Committe Reported to Dropdown values based on two condition to my sharepoint list. But i am getting the errroon the lookup part please help in fixing it. I have highlighted the error part

Note: I had created a list and from that list i customised it to power apps and created the form and facing this issue.
 
If(
    DataCardValue2.Selected.Value = "Lesson Learned" && DataCardValue12.Selected.Value = "Yes", 
    ClearCollect(
        GeneratedRows, 
        ForAll(
            ["ASI", "АWM", "САО", "ССВ", "СОО", "CIB", "Corporate Responsibility", "DEST", "Finance", "HR", "Legal", "RISC", "SGO", "TC10", "Technology", "EMEA", "LATAN Canada", "APAC", "3LEs"],
            {
                'Review Type': DataCardValue2.Selected.Value,
                'Event Type': DataCardValue3.Selected.Value,
                'LL/Read Across Name': DataCardValue9.Text,
                'Date Selected as LL/Read Across': DataCardValue5.SelectedDate,
                'Date Completed LL/Read Across': DataCardValue6.SelectedDate,
                '# of Days': DataCardValue4.Text,
                'Upload Completed LL/Read Across': DataCardValue14.Attachments,
                'Results': DataCardValue13.Text,
                'Date of Control Committee where LL/Read Across Shared': DataCardValue15.SelectedDate,
                'CHLM Date': DataCardValue10.SelectedDate,
                'CHUM Disposition & Applicable to Read Across': DataCardValue12.Selected.Value,
                'CHUM Disposition Date': DataCardValue7.SelectedDate,
                'Control Committee Reported To': ThisRecord
            }
        )
    )
);
ForAll(
    GeneratedRows,
    If(
        IsBlank(
            Lookup(
                Tracker_V1, 
                'Review Type'.Value = ThisRecord.'Review Type'.Value &&
                'Event Type'.Value = ThisRecord.'Event Type'.Value &&
                'Control Committee Reported To'.Value = ThisRecord.'Control Committee Reported To'.Value
            )
        ),
        Patch(
            Tracker_V1, 
            Defaults(Tracker_V1),
            {
                'Review Type': {Value: DataCardValue2.Selected.Value},
                'Event Type': {Value: DataCardValue3.Selected.Value},
                'LL/Read Across Name': If(IsBlank(DataCardValue9.Selected.Value), DataCardValue9.Text, DataCardValue8.Selected.Value),
                'Date Selected as LL/Read Across': If(DataCardValue2.Selected.Value = "Lesson Learned", Today(), DataCardValue5.SelectedDate),
                'Date Completed LL/Read Across': DataCardValue6.SelectedDate,
                '# of Days': DataCardValue4.Text,
                Attachments: DataCardValue14.Attachments,
                'Control Committee Reported To': ThisRecord.'Control Committee Reported To',
                'Results': DataCardValue13.Text,
                'CMLM Date': DataCardValue10.SelectedDate,
                'CMLM Disposition & Applicable to Read Across': {Value: DataCardValue12.Selected.Value},
                'CMLM Disposition Date': If(DataCardValue2.Selected.Value = "Lesson Learned", Today(), Blank())
            }
        )
    )
)
WhatsApp Image 2024-12-24 at 19.38.42.jpeg
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,733 Most Valuable Professional on at
    There are a number of fundamental issues here I will try to list out.
    Firstly for your initial issue, try using the As disambiguation function instead of ThisRecord.
    You are also running the Patch irrespective of whether you collect the first part - this needs to be in the same If() statement structure.
    The last item in the collection need to refer to Value, which is the field name of the table at the top.
    You cannot Patch Attachments that way - they need to be saved either by SubmitForm or Patch(FormName.Updates)
     
    If(
       DataCardValue2.Selected.Value = "Lesson Learned" && 
       DataCardValue12.Selected.Value = "Yes", 
       ClearCollect(
          GeneratedRows, 
          ForAll(
             ["ASI", "АWM", "САО", "ССВ", "СОО", "CIB", "Corporate Responsibility", "DEST", "Finance", "HR", "Legal", "RISC", "SGO", "TC10", "Technology", "EMEA", "LATAN Canada", "APAC", "3LEs"],
             {
                'Review Type': DataCardValue2.Selected.Value,
                'Event Type': DataCardValue3.Selected.Value,
                'LL/Read Across Name': DataCardValue9.Text,
                'Date Selected as LL/Read Across': DataCardValue5.SelectedDate,
                'Date Completed LL/Read Across': DataCardValue6.SelectedDate,
                '# of Days': DataCardValue4.Text,
                'Upload Completed LL/Read Across': DataCardValue14.Attachments,
                'Results': DataCardValue13.Text,
                'Date of Control Committee where LL/Read Across Shared': DataCardValue15.SelectedDate,
                'CHLM Date': DataCardValue10.SelectedDate,
                'CHUM Disposition & Applicable to Read Across': DataCardValue12.Selected.Value,
                'CHUM Disposition Date': DataCardValue7.SelectedDate,
                'Control Committee Reported To': Value
             }
          )
       );
       ForAll(
          GeneratedRows As _Rows,
          If(
             IsBlank(
                Lookup(
                   Tracker_V1, 
                   'Review Type'.Value = _Rows.'Review Type'.Value &&
                   'Event Type'.Value = _Rows.'Event Type'.Value &&
                   'Control Committee Reported To'.Value = _Rows.'Control Committee Reported To'.Value
                )
             ),
             Patch(
                Tracker_V1, 
                Defaults(Tracker_V1),
                {
                   'Review Type': {Value: DataCardValue2.Selected.Value},
                   'Event Type': {Value: DataCardValue3.Selected.Value},
                   'LL/Read Across Name': 
                   If(
                      IsBlank(DataCardValue9.Selected.Value), 
                      DataCardValue9.Text, 
                      DataCardValue8.Selected.Value
                   ),
                   'Date Selected as LL/Read Across': 
                   If(
                      DataCardValue2.Selected.Value = "Lesson Learned", 
                      Today(), 
                      DataCardValue5.SelectedDate
                   ),
                   'Date Completed LL/Read Across': DataCardValue6.SelectedDate,
                   '# of Days': DataCardValue4.Text,
                   Attachments: DataCardValue14.Attachments,
                   'Control Committee Reported To': _Rows.'Control Committee Reported To',
                   'Results': DataCardValue13.Text,
                   'CMLM Date': DataCardValue10.SelectedDate,
                   'CMLM Disposition & Applicable to Read Across': {Value: DataCardValue12.Selected.Value},
                   'CMLM Disposition Date': 
                   If(
                      DataCardValue2.Selected.Value = "Lesson Learned", 
                      Today(), 
                      Blank()
                   )
                }
             )
          )
       )
    )
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn    Buy me a coffee

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 279 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 229 Super User 2026 Season 1

#3
VASANTH KUMAR BALMADI Profile Picture

VASANTH KUMAR BALMADI 195

Last 30 days Overall leaderboard