Fx Field to Display Date or Text Depending on If Statement
Hi,
In the standard view (all) for record entries, I would like a column that displays either a date that was recorded as a field or text if that date field was not completed.
So far I have..
let wavDep := Orders.'Waver Deposit';
if wavDep = text("Yes") then
text("N/A")
else
if wavDep = text("No") then
Orders.'Date Deposit Paid'
else
if wavDep = false then text("Incomplete") end
end
end
and it returns the following error - return type mismatch
I get that one is a date and one is text but I dont know quite how to overcome this.
Any help is appreciated.
Craig
5 replies
-
Try this:
let wavDep := text(Orders.'Waver Deposit');
if wavDep = "Yes" then
"N/A"
else
if wavDep = "No" then
text(Orders.'Date Deposit Paid')
else
if wavDep = null then "Incomplete" end
end
endSteven
-
Hi Steven,
Thank you for your reply.
That has work in most instances other than displaying the date. Incomplete or N/A displays but it is just a blank field whenever a date should be displayed.
I am wondering if it to do with formatting so I will keep trying but if you have an idea what may have caused it feel free to let me know, it would be greatly appreciated.
Craig
-
Ok so, this is taking a lot more figuring out that I would have expected.
I can only ever get one of the outputs to show, either the date the deposit was paid or the text, I cant get both to show up when they are relevent.
let dateAsTxt := format(date(Orders.'Date Deposit Paid'), "DD/MM/YYYY");
if Orders.'Waver Deposit' = true then
"No Dep. Paid"
else
dateAsTxt
endThis is what I have now, and basically I get the date or a black field not the text I want.
-
let dateAsTxt := text(format(date(Orders.'Date Deposit Paid'), "DD/MM/YYYY"));
Content aside
- Status Answered
- 2 yrs agoLast active
- 5Replies
- 582Views
-
1
Following