Select all used values of a specific field as source for dialog list choices - lotus-notes

In my Lotus Notes Database, I want to fill the choices available in a dialog list based on the previously entered values for this field.
I set type of the field to "Dialog list", chose "Use formula for choices" and selected "Allow values not in list".
However, I don't know what to enter as a formula:
The formula's result should be all values for the field Foo specified in the database.
I tried the following formula which results in an empty list, however:
#Unique(SELECT Foo)
There are definitely documents with values for Foo in the database.
Which formula can I use?
Or do you know better solutions to my problem than using a formula?
Many thanks in advance for your responses!

You need to create a view with at least a column that displays the Foo field. You can then use #DbColumn in your formula to retrieve all values from e.g. column 1 containing the Foo field:
#Unique(#DbColumn("";"":"database.nsf";"Your new view";1))
Here is more informatiom about #DbColumn: http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/index.jsp?topic=%2Fcom.ibm.designer.domino.main.doc%2FH_GENERATING_CHOICES_FOR_LISTS_STEPS.html

Similar way, but error handling included.
Look := #DbColumn("":""; ""; "$LookFoo"; 1);
#If(#IsError(Look); ""; #Unique(Look))
Database parameter can be empty, if you are reading from the current. If there is a problem with cache, you can make first parameter like - #DbColumn("":"NoCache";...
Hope it helps.

Related

Create a manual data validation list in Excel

I want to make a very simple manual dropdown list in a cell with the values Yes or No.
I do not want to select a range of possibilities for only 2 options. So I want to enter the possible values manually.
It is my understanding according to these articles (link1, link2), that I can do so by going to a cell, going to data > data validation. Select List from the allow dropdown and then in the source field enter my dropdown entries manually (comma seperated).
However, if I do so, I get this:
So, I get only 1 option Yes,No instead of 2 options with Yes or No. What am I doing wrong? I tried seperating them with a comma and a space aswell. Didn't work.
In source, write this Yes;No instead of Yes,No
first:
Control panel--> Region-->Formats Tab-->Additional settings--> Numbers Tab-->List separator value change to: ,(comma) then ok.ok

Multi LookUp - Check for unique values

I´m trying to set up unique values in my PowerApp-Form. The data is stored in a Sharepoint list. I have a column called watches, items in this column have a unique number, which have to be unique. People can pick multiple of those watches in a LookUp-field. But before submitting the form, I need to check if those picked values already exist in my list and at least display an error message.
I have setup a regular text field and added following rule to it:
If(LookUp(MyList.Watches;DataCardValue4.SelectedItems.Value in Watches;"OK")<>"OK";"No Error";"Watch already exist")
DataCardValue4 is my LookUp field, where people can pick those watches. With this rule I want to check if a item already is in my column watches and let my text field display the error. Somehow the rule doesn´t work.
Can you tell me how I compare multiple lookup choices to my table/column entries?
The first parameter to the LookUp function should be the table (SharePoint list) rather than the column. So the first parameter should be 'MyList' rather than 'MyList.Watches'. Also, I'm not sure that the formula provided (second parameter to LookUp) will work. In your formula, you will be looking for multiple items (DataCardValue4.SelectedItems.Value) within multiple items (Watches). Perhaps you can update your app to have users only pick one watch value before submitting?
One last thing to note. I'm not sure how big you expect your SharePoint list to get, but I would highly recommend keeping your LookUp formula within the bounds to support delegation. More specifically, SharePoint has different formula requirements than other connectors. For example, you can use '=' in your formula, but not 'in'.
Your new rule might look something like below. Please note that it could have syntax errors and might not even be delegable in it's current form since I am providing the rule with no checking. Also, I switched from using LookUp to using Filter instead just because I'm more familiar with Filter. However, both functions are very similar.
If(CountRows(Filter(MyList; DataCardValue4.Selected.Value = Watches)) > 0; "Watch already exist"; "No Error")

Saving SharePoint list item as draft without required fields

E.g. there is a list with gazillion required fields and I want the users to be able to fill out whatever they can and save as a draft until they have full info? Is there a simple solution for this? Tia!
Option 1: Multiple Content Types
One approach is to have two different Content Types on your list: one for draft items and one for submitted ones.
Content types on the same list can have different settings for the same columns. This means you can make the fields optional on the "draft" content type while making them required on the "submitted" content type.
The downside is that it may not be intuitive for end users if they're required to manually change the "Content Type" field in order to publish their draft.
Option 2: List Validation Settings
Another approach is to use List Validation settings instead of making fields required.
List validation lets you specify an Excel like formula (from which you can reference column values) which must evaluate to true in order for the validation to succeed. If it evaluates to false, a validation error message is displayed instead (you can specify the text of that message) and the item cannot be saved.
Simplified Scenario: One Field
Suppose you have a field called First Field that you don't necessarily need to be filled out right away, and you also have a choice field called Status Field that's used to indicate whether an item is a draft version or is submitted (displaying either "Draft" or "Submitted").
You can set up a list validation formula that requires First Field to be filled in whenever the Status Field is changed to "Submitted".
The formula would look like this:
=If([Status Field]="Submitted",NOT(ISBLANK([First Field])),TRUE)
In plain English, that formula is saying:
If Status Field is equal to Submitted...
...Then the form is valid only if First Field is not blank.
Otherwise, the form is valid.
More Complex Scenario: Multiple Fields
To make that work for multiple fields, you can join conditions together using the OR() and AND() functions, in the format of OR(condtion1,condition2)
So instead of ISBLANK([First Field]) to check whether a field is blank, you'd have something like OR(ISBLANK([First Field]),ISBLANK([SecondField])) to check whether either of two fields is blank. (Replacing First Field and Second Field with your field titles as appropriate.
The formula would now look like this:
=If([Status Field]="Submitted",NOT( OR(ISBLANK([First Field]),ISBLANK([Second Field]))),TRUE)
Note that you can nest multiple OR() conditions together arbitrarily, in the format of OR(condition1, OR(condition2, OR(condition3, condition4))) (and so on indefinitely).
Offloading Formula Complexity to Calculated Columns
If you run into limits with the formula length, you can offload some of your condition calculations into their own calculated columns, then just refer to those column values from your validation formula.
This can also help keep your formula from looking so complex.
For example, for every field that you want to be required, you can create a calculated column with a formula of =NOT(ISBLANK([Column Name])) and name it something like "{Column Name} Is Valid". Then you can refer to those columns in your validation formula:
=If([Status Field]="Submitted",AND([Field1 Is Valid],AND([Field2 Is Valid],[Field3 Is Valid])),TRUE)

how to autocomplete values based on a list

I created many Lists and they are getting longer. At the moment i am using data validation, so I have big lists and need to select the name i want
They are all listed on my formulas, so i would like to know if there is any way
to start to write the name that i need and excel already shows the
possibilities...
I tried to use this formula but was not successful
=OFFSET(Sheet1!$A$1,0,0,MATCH("*",Sheet1!$A$1:$A$300,-1),1)
For instance i have a list of currencies called "CCY", i would like to write
"US" and excel already shows USD. Is there any way to do that?
=OFFSET(Currency,MATCH(A2&"*",Currency,0)-1,0) 'A2 is where the validation applies, make sure it accepts values not in list
You can enter the value in a second go, will let you select from values after.
I wouldn't use it but
It will let you select any value from the drop-down
You can let it do its job by typing "us", Tab, Shift+Tab, Alt+Down and Tab quite fast.
The formula below won't let you select values after, takes the first match only, handle with care.
=OFFSET(Currency,MATCH(A2&"*",Currency,0)-1,0,1,1) 'fun fact: you can give names to data table columns thus creating expanding lists

In a Notes field with a dialoglist, how can I display a blank as "None" for example?

I have a field where Yes and No are the valid selections in the dialoglist, the valid values for the field are setup with Synonyms like this Yes is Y and No is an empty value/blank/nothing.
Yes|Y
No|
When the document is saved this the field selection of "No" and re-opened how can I get the form field to display the word "No" when the field is blank?
It's not possible to accomplish that just with an alias definition.
You could work with two fields to get an empty field for "No":
Your current field let's say "TestUI" of type dialog list would have the choises
Yes|Y
No|N
and an additional computed text field "Test" with the formula
#Replace(TestUI; "N"; "")
would replace the "N" with an empty string.
You can avoid the two field solution by using a PostOpen formula:
FIELD MyDialogList := #If(MyDialogList="";"No";MyDialogList);
#All
P.S. I'm not sure what your intention was here, but this is actually not a bad way to deal with the case where you're adding a new field to an old form and you don't want to have to run an agent to add the new field to all previously saved documents. Since formulas just treat missing fields as empty strings, the #If will work as expected.
It seems like you've run into an edge case and you probably will need to assign some value as the alias to "No".
If it is really important to have the value be blank when a user selects No, you could create a second computed field that maintains the alias values. Assuming your dialog list field is called "YesNo", your computed field's formula could be:
#If(YesNo = "Yes"; "Y"; "");

Resources