Azure Search, Track deletions don't work - azure

As you can see bellow, The "IsActive" column define to detect deletion.
If I go to the DB and change a record "CreationTime" and some data, after running the indexer the changes are applyied in the search service.
Though if I go to the DB and change the IsActive column to 0 (false, since it is a bit column) and the creation time off course, after running the indexer I expect the record to disapear from the search service but it is still there.

When updating IsActive column, you need to also update CreationTime to indicate that the row has changed.
Also, Azure Search sees BIT columns as boolean values instead of 0/1 - so try using "false" as the delete marker value.
Note that SQL integrated change tracking policy would take care of both updates and deletes - consider using it if possible.

The value needs to be set as a string in quotes, so for you, the exact value that you should put in the field "Delete Market Value is "false" including quotes.

IsActive column to 0 (false, since it is a bit column)
Here's the problem. According to the newest documentation:
if you have an integer column where deleted rows are marked with the
value 1, use "1". If you have a BIT column where deleted rows are
marked with the Boolean true value, use the string literal True or
true, the case doesn't matter.
So in my case (BIT column), I've set true (without quotes) as delete marker value and everything works like a charm.

Related

Query calculated field with IIF statement

I have an Access table called Snaps which I want to query from Excel in VBA.
The following query works:
SELECT SUM(Cash) FROM Snaps WHERE Balance>50 AND SnapshotDate=#2020-06-30 00:00:00#
If I add another condition on a calculated field created in Access which I call IsEligible, and the value of which is a boolean, then, none of the following works:
SELECT SUM(EligibleNotionalBalance) FROM Snaps WHERE ArrearsStatus=Current AND SnapshotDate=#2020-06-30 00:00:00# AND IsEligible = -1
SELECT SUM(EligibleNotionalBalance) FROM Snaps WHERE ArrearsStatus=Current AND SnapshotDate=#2020-06-30 00:00:00# AND IsEligible = TRUE
SELECT SUM(EligibleNotionalBalance) FROM Snaps WHERE ArrearsStatus=Current AND SnapshotDate=#2020-06-30 00:00:00# And IsEligible = 'true'
I have add similar issues in the past, which I overcame by changing the formula in my calculated field. Essentially this consisted in removing the IIF statetement that I had. However, it only showed values when the result was False, which I don't really like. Does anyone have a guess?
Thanks!
So, not sure about the Group by and Having in this case. However, it now works. It seems I had some connection issues, which I realised after shrinking the query to the most simple possible format.
The " =-1 " actually works!

How to fix If Statement that only returning False once one false is found

I have three spreadsheets in total. My primary spreadsheet contains all the important details as described below in the first photo. The combined files sheet does exactly as it sounds. Since there were multiple entries with the same part number but different photos it takes the part number and used a text join to combine all the same part numbers photos with it's files on a single line delimited by a comma. The pivotal table just allows me to visually see part numbers and its associated files.
This is the primary sheet that contains all the details like part description, pricing, specifications, etc.
Currently on the primary sheet when I use an if statement to reference the comma separated file names, I'm running into a case where a part number exists on the primary sheet, but does not exist on the combined sheet. Because the part number doesn't exist it will return false, which is correct. However, it will get stuck returning false forever after one is found. So once that first one failed the logical test and returned false everything after is returned false despite having logical tests on the if statements being true after that single false occurrence.
Pivot Table to show looking up a partnumber that doesn't exist.
This table uses the pivot table and text join to place the file images together delimited by a comma.
Below is the if statement used, even adding a false return value of "" or something like .png no matter what it will get stuck return that false value for everything after.
=IF([#punctuatedPartNumber]=Table7[#PunctuatedPartNumber],Table7[#[Combined Files]])
EDIT #2
I think the problem may be using [#xxxx] in the IF function. You can use INDEX+MATCH to return the corresponding CombineFiles for each PartNumber.
Your function may look like the following:
=INDEX(Table7[Combined Files],MATCH(A1,Table7[PunctuatedPartNumber],0))
Replace A1 with the cell address of the first punctuated part number on your primary sheet.
Let me know if there is any problem. Cheers :)

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")

Can someone help me with Exception occurred calling method NotesDatabase.FTSearch(string)

I'm trying to do a database full text search and struggling to get it to work.
Since I'm working with date fields, I deleted my full text index, set all my blank date fields to a fictitious date (3/15/2050), compacted the db and then rebuilt the full text index.
However, I am still getting the error for this query string:
(FIELD Form CONTAINS 'Opp') AND (FIELD Topic CONTAINS 'A') AND (FIELD DateTeam >= 3/1/2019) AND (FIELD DateTeam <= 3/31/2019)
I didn't have the single quotes in there initially, but tried it as a suggestion from another post. I also tried putting # before and after my dates, but no luck there either.
What am I missing? My customer is getting frustrated.
You didn't post the verbiage in the exception, nor say what Domino version you were using, so this is somewhat guesswork.
It could be that the UNK table (Domino's internal field catalog) thinks the field is a string field. The first value stored in a field is the type that the FT index uses to determine the indexed data type. Of course any type can be stored in the NSF data but the FT code tries to limit this type of search to fields it believes will work.
Now if those CONTAINS values are actually = values, then DQL can help you. We'll be putting CONTAINS as a verb into DQL in V11, but it (DQL) can certainly perform your date range term. Just a thought.
-John Curtis
This might help: https://www-10.lotus.com/ldd/dominowiki.nsf/dx/full-text-syntax
As far as I know date values must be in [] to work.
A good start is to test your formula in the client with the FT search function instead of altering your code.
By the way: you can shorten your formula omitting the FIELD keyword and putting the field name also in [].
I tried this in my mail database:
(FIELD Form CONTAINS "Memo") AND (FIELD Subject CONTAINS "the") AND (FIELD PostedDate >= 3/1/2019) AND (FIELD PostedDate <= 30/6/2019)
And it works correctly. So double quotes instead of single, and you might have to check whether your date format corresponds with the server's.
The approach I was taking was correct. The problem, however, was that my update agent to set all the date fields had a typo in it so it wasn't setting the right fieldnames to dates. My oversight. Once I found that and corrected it, I retraced my steps and it all works as intended now. Thank you to all for helping me find the solution.
For anyone else, I took these steps:
Open database properties and delete the full text index
Run this command on the console to compact the db: lo compact folder/db.nsf -c
Run an agent against all the docs to set the date fields to a fictitious date
Open database properties again and create a new full text index
When completed, run this command on the console: load updall -f folder/db.nsf
Run the agent again to reset the fictitious dates to blanks

How to check more than 5 fields under action rule condition in infopath 2010

I am working on an infopath 2010 form/view based on a list.
I have 7 separate check box fields that I want to check through a rule under submit button that at least one of them should be selected.
Trying to do this and check for the condition, it is allowing me to check a maximum of 5 fields at a time.
How can I check at least one of these 7 check boxes is selected before submitting the data?
You can overcome this by changing your last condition to "The expression" and use "and" or "or" as needed to create your compound condition. So, for example, if you need to make sure both field1 and field2 are not blank, you'd use the expression:
my:myFields/my:field1 != "" and my:myFields/my:field2 != ""
If you need help figuring out the correct syntax for your expression, first set up the condition using the drop downs (for example, select field1 in your first drop down, then "is not blank" in your second drop down), then change the first drop down to "The expression" -- whatever your condition was will auto populate into the box for the expression. Paste that into a text editor, and then do the same for the rest of your conditions. Add and or or between them as needed, and you have your expression!
Source: http://www.infopathdev.com/forums/p/14871/52819.aspx
I had a similar issue and avoided using "The Expression" option because I had so many conditions to check before allowing a user to submit the form for certain scenarios, and it would have been very tough to debug and troubleshoot. I also considered Glen's sum-based solution because it made troubleshooting difficult as you can't really tell which condition is missing, and you can't perform logical checks on what's been selected or filled-in properly.
My solution was to set up a text CheckStatus field and a numeric CheckStatus-Value field. Rules on tested fields would add values to the CheckStatus field when the needed conditions were met. And when the CheckStatus-Value field hit the “magic number” (6 in the example below), then I would allow the user to submit the form. As an example, the CheckStatus-Value and CheckStatus fields are shown below, but would be hidden when the form is ready for production use:
CheckSum-Value & CheckSum fields
Then for every desired field, I assign a unique letter from “A” to “Z”, or from “a” to “z”, or from “0” to “9”, and test for the desired condition. In this way you could test for up to 62 concurrent conditions, tho that would be a bit crazy 😊 Every time the CheckStatus field changes, a rule runs to count the number of values and update CheckStatus-Value:
Update CheckSum-Value field
IF the condition is True AND the CheckStatus field does not already contain the unique letter/number assigned to that field, then I add the assigned number/letter (using the concat function) to the CheckStatus field. If a blank value is a valid value under specific conditions then I add the letter/number for the field when that condition is met, so a ready-to-submit form always has the same value in the CheckStatus-Value field. (If a valid value is changed to a different valid value, ensure the letter/number is only added ONCE to the CheckStatus field.)
Add value A to CheckStatus field
 
IF the condition is False, then I remove the assigned number/letter (using the translate function) from the CheckStatus field.
Remove value A from CheckStatus field
IF the field being tested (Field-A) is dependent on another field (Field-B), I also add the Field-A rule to Field-B, so the user does not have to touch Field-A to update the CheckStatus. Be careful when copy-pasting the rules; remember InfoPath will change field names automatically! I also added the “’Add-x”’ rules to the Form Load rules (on the Data tab) to update CheckStatus every time the record is loaded.
Hope this helps!
-Steve
Here's an idea: Use an integer field and put a rule on each of your 7 checkboxes that adds 1 to the field. Then your final validation rule just needs to be sure the integer field is greater than zero
(Better also have a rule to subtract 1 if a box is unchecked after being checked.)
-Glen

Resources