any correction required in below code, it showing error as invalid arugument type ,expecting boolean.
If(LookUp(
'backup',
Title =TextInput2.Text),
Patch(
'backup',
LookUp(
'backup',
Title = TextInput2.Text),
{Title: TextInput2.Text},
{Source: TextInput3.Text}
),
Patch(
'backup',
Defaults('backup'),
{Title: TextInput2.Text},
{Source: TextInput3.Text}
)
)
@venky232 Possibly better version:
//untested - adjust as needed
With
(
{
_myRecord
,LookUp
(
'backup'
,Title =TextInput2.Text
)
}
,Patch
(
'backup'
,{
ID:If(!IsBlank(_myRecord,_myRecord.ID,Blank())
,Title:TextInput2.Text
,Source:TextInput3.Text
}
)
)
If any problem with the above, try this below:
Check if turning on the formula-level error management setting helps with any issue:
1. Click Settings
2. Click Upcoming Features
3. Toggle the Formula-level error management setting to On
Then just close the modal, see if it works.
//untested - adjust as needed
With
(
{
_myRecord
,LookUp
(
'backup'
,Title =TextInput2.Text
)
}
,If
(
!IsBlank
(
_myRecord
,Patch
(
'backup'
,{
ID:_myRecord.ID
,Title:TextInput2.Text
,Source:TextInput3.Text
}
)
,Patch
(
'backup'
,{
Title:TextInput2.Text
,Source:TextInput3.Text
}
)
)
)
)
Hi @venky232 ,
That is because you need to test the top statement with IsBlank, but try this
With(
{
wID:
LookUp(
'backup',
Title = TextInput2.Text
).ID
},
Patch(
'backup',
If(
IsBlank(wID),
Defaults('backup'),
{ID: wID}
),
{
Title: TextInput2.Text,
Source: TextInput3.Text
}
)
)
Please click Accept as solution 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 Thumbs Up.
Visit my blog Practical Power Apps
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional