Hi Everybody. I need your help!. I created a basic InfoPath 2013 form for a SharePoint list and can´t figure out why the count() function is not returning the expected result. I created a form with 4 fields (Device - Location - Key (Device + Location) - Number). The first two fields are drop-down lists. The first one gets the data from another SP list containing devices name, the second drop-down it has a list of cities listed in a second SP list and the Key field is basically the result of concatenating Devices and Location. Im trying to get the number of records in the main SP list (I assume it is the one for the form) that match the key field but for some reason isn´t counting. I created a rule for the Location field to set the Key field value with the result of concat(Device + Location) and then set the Number field with the result of count(Key [. = "Key"]. I created a secondary data connection to the main list trying to make this work but after many attemps I had not good results. See below example:
Device: IPad
Location: Chicago
Key: IPadChicago
DNS: xxxx
If there are two records in the main list having for example "IPadChicago" in the Key field then the next DNS number should be 3 as the result of count(Key [. = Key] + 1. For some reason the the formula is not retrieving the value of the key field at the time of running the count() function so Im wondering if there is something that Im doing wrong or if this is a bug. This is a very simple form as you can see and the only way I could make the count() function to work was by hardcoding the value i.e. count(Key [. = "IPadChicago"]) but this is not very usefull.
Thanks you very much for your time and I appreciate your help.