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
Solution Sage
Solution Sage

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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

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

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,633)