I downloaded the New Ticker database from the sandbox and I would like to modify how it works, ever so slightly.
The database looks into a view and pulls a text field in the second column.
I would like to create a default message when there are no documents in the view. I do not want to create a default document for that view.
Is there a way to determine if a view is empty in formula language?
Here is the code I have tried in a computed field:
defaultmessage:=“"”+“No reported outages, all systems are available”+“"”;
notice:=“"” + @Implode(@DbColumn( “” : “NoCache” ; “”:“” ;“V_NT_ENTRIES” ;2 );“","”) + “"”;
@IF(notice=" "; defaultmessage; notice)
What did I do wrong?
Subject: News Ticker
at the least change the " " to “” in this line, @IF(notice=" "; defaultmessage; notice)
had I used this formula, I would also try to store the dbcolumn result in a variable, without performing any other processing to it like @implode, then I would use @IsError to ensure so errors existed during the dbcolumn execution and would then contine with the rest of the processing… hope it helps…
Subject: News Ticker
I figured it found, I had to determine the number of elements in the list. If the list was equal to zero, then display my default message.
defaultmessage:=“"”+“No reported outages, all systems are available”+“"”;
numelement:=@DbColumn( “” : “NoCache” ; “”:“” ;“V_NT_ENTRIES” ;2 );
notice:=“"” + @Implode(@DbColumn( “” : “NoCache” ; “”:“” ;“V_NT_ENTRIES” ;2 );“","”) + “"”;
@If(@Elements(numelement)=0;defaultmessage;notice)