cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Expected action not getting when Patching only if the record not existing in SharePoint List

Hi Team,

 

I'm having a collection called CalenderDB (primary key is TPoint), which I'm transferring to a SharePoint called BookingResponces (primary key is Title).

 

After looking at many solved problems in this site, I created a button OnSelect formula which is now giving me a problem with no proper results. Warnings shown are "Incompatible type. We can't evaluate your formula because the values begin compare in the formula aren't the same type".

 

ForAll(
       CalenderDB,
       If(IsEmpty(Filter(BookingResponces,Title=CalenderDB[@TPoint])),
          Patch(
              BookingResponces,Defaults(BookingResponces),
              {Title=CalenderDB[@TPoint], N101=CalenderDB[@N101],N102=CalenderDB[@N102]})
       )
)

 

 

Appreciate your kind support on this to me. Cannot figure out why this is coming as I believe the logic is okay.

 

Thanks

Dhanushka

 

2 REPLIES 2
Highlighted
Super User
Super User

Re: Expected action not getting when Patching only if the record not existing in SharePoint List

What language is your Studio running as? There may be different syntax requirements, but the immediate issue I see is that you need to map destination fields using a colon.

ForAll(
       CalenderDB,
       If(IsEmpty(Filter(BookingResponces,Title=CalenderDB[@TPoint])),
          Patch(
              BookingResponces,Defaults(BookingResponces),
              {Title: CalenderDB[@TPoint], N101: CalenderDB[@N101],N102: CalenderDB[@N102]})
       )
)
Highlighted
Frequent Visitor

Re: Expected action not getting when Patching only if the record not existing in SharePoint List

Hi @GarethPrisk ,

 

Thank you so much and extremely sorry for my delay.

 

Yes, I have put in the syntax as (I mistakenly put in "=" instead of ":" when I was writing the problem. Sorry).

ForAll(
       CalenderDB,
       If(IsEmpty(Filter(BookingResponces,Title=CalenderDB[@TPoint])),
          Patch(
              BookingResponces,Defaults(BookingResponces),
              {Title: CalenderDB[@TPoint], N101: CalenderDB[@N101],N102: CalenderDB[@N102]})
       )
)

 

My Problem is can there be a problem in comparing/evaluating "Title" which is the column name of my SharePoint list with the CalenderDB[@TPoint] which is giving a array values (TPoint is the primery key column of CalenderDB collection). Is "ForAll" correct function to use?

 

Appreciate your kind attention.

 

Thanks

Tharindu

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

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

Experience what’s next for Power Apps

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

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,402)