Jump to content

comment

Members
  • Content Count

    29,192
  • Joined

  • Days Won

    696

comment last won the day on March 24

comment had the most liked content!

Community Reputation

1,654 Excellent

About comment

  • Rank
    consultant

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Not really, because I don't understand what you're describing. I answered in general, picking on the two phrases that made some sense to me. The rest is very vague (to me, anyway). I suspect your basic approach is wrong. At least I cannot think of a scenario where it would be necessary - or desirable - to tag one record among many as "master". That's not how a relational database is supposed to be organized. But again, I am speaking in general and I could well be missing the big picture here.
  2. It's hard to tell what exactly you're looking for. There are a few methods "to store previous iterations of each field" - do a search for 'audit log'. However, the main purpose of these methods is to increase data integrity, not to "show progress or change over time". Such goal would be much better served by creating a new record for every change. If the entity you're tracking has many attributes, and you want to track the progress of each attribute individually, then consider using the EAV data model.
  3. More or less the same as: https://fmforums.com/topic/105968-export-image-list-to-separate-records/?do=findComment&comment=479010 In version 18 you also have the options of writing directly to the text file: https://fmhelp.filemaker.com/help/18/fmp/en/index.html#page/FMP_Help%2Ffiles-script-steps.html%23
  4. So basically you have: Genus -< Species -< Plant -< Plantings -< Locations and you want to filter a portal to Locations by an attribute of its parent Plantings. For this, you have two options: 1. Place another occurrence of Plantings "behind" Locations: Genus -< Species -< Plant -< Plantings -< Locations >- Plantings 2 and use it in your filtering expression, e.g.: IsEmpty ( Plantings 2::Status ) 2. Define a calculation field in Locations as = Plantings::Status and use this field to filter your portal. What you have now looks only at the first related record in Plantings from the context of Genus. So the portal will show either all related records from Locations or none - according to the status of that record. You will observe the same principle if you try to add a field from Plantings (or Plant or Species) to the portal: it too will display the same value in all portal rows.
  5. I believe this refers to a script triggered by an OnObjectValidate event: https://fmhelp.filemaker.com/help/18/fmp/en/index.html#page/FMP_Help%2Fonobjectvalidate.html%23 If you attach such script trigger to the field's instance on a layout, the script will run before the field is validated, allowing you to interact with the user using a custom dialog or a new window before (or instead) of the validation error message.. If the constrain is critical, I would still keep the validation in place. Script triggers work only on the layouts where they have been installed. Field validation works at the data level.
  6. I too couldn't understand what this file was about. I made myself a very simple tool - basically just: You paste your JSON into the JSON field and build your keyOrIndexOrPath expression step-by-step by observing the result of cListkeys as explained above until cGetElement returns the expected result.
  7. They are not, but some of us read both. You are welcome to post on both, but a heads up would be appreciated in order to save duplication of effort.
  8. This is a cross-post: https://community.claris.com/en/s/question/0D50H00007oQM1MSAW/executesql-how-do-i-sort-my-columns-by-count-value-but-only-display-the-value-in-the-results The answers you were given there are practically the same as the one given above. I agree. I would suggest a native alternative, but I am not sure what is the exact purpose of this exercise.
  9. The problem here is not curly braces, but square brackets. Same as with your previous question, these signify an array whose objects need to be accessed by their index number. In this case there is only one object, so the expression: JSONGetElement ( $$_JSON ; "list[0].weather[0].id" ) will return 801. Do note that list is also an array and it contains no less than 40 objects. The above expression extracts the weather id value from the first object only. Not all objects have the same weather id value, for example: JSONGetElement ( $$_JSON ; "list[2].weather[0].id" ) returns 800. How to solve such problems in general: It is very convenient to use the JSONListKeys() function to analyze the given JSON and help to select the next step in your keyOrIndexOrPath expression. Starting with an empty path, the expression: JSONListKeys ( $$_JSON ; "" ) returns: city cnt cod list message If you pick list, then: JSONListKeys ( $$_JSON ; "list" ) will tell you there are 40 objects to pick from. If you pick the first one, then: JSONListKeys ( $$_JSON ; "list[0]" ) will return: clouds dt dt_txt main sys weather wind Next: JSONListKeys ( $$_JSON ; "list[0].weather" ) returns "0". This is how we know it's an array containing a single object. And finally: JSONListKeys ( $$_JSON ; "list[0].weather[0]" ) gives us: description icon id main allowing us to construct the final path used above. -- Note that the dots after the index predicate are optional; the expression: JSONGetElement ( $$_JSON ; "list[0]weather[0]id" ) will work just as well.
  10. it would still be a button. But it would simply do: Set Field [ Preferences::ProductCodeColorNumber ; 1 ] or another number between 1 and 8. No. Each product code stores a single color number, so you only need a simple Number field, with no repetitions. The number field needs no visual cues. It doesn't even need to be shown. You can apply conditional formatting to the ProductCode field, using the same rules and same colors as for the Status field in Products. -- Note: This is all assuming you want to use conditional formatting. If you prefer, you could store the RGB values in the Preferences table and apply them by auto-entering a calculated value into the Status field using TextColor(). But then changing the colors in Preferences becomes more difficult to apply to existing records in Products.
  11. Not sure I understand what exactly is your question. The colors used in conditional formatting must be preset in advance. They cannot be calculated or set by script. If - as it seems from the screenshots - you want to allow users to pick a color from a fixed selection of preset colors and assign it to a product code, you could store the selection in your preference table as a simple number (from 1 to 8, in your example). Then you can define 8 rules for your conditional formatting along the lines of: Preferences::ProductCodeColorNumber = 1 and assign one of the preset colors to each rule. Note that this requires a relationship between Products and Preferences matching Status to ProductCode.
  12. I too would recommend against using a repeating field for this. Splitting lines of text into separate related records is very easy, and you don't need to create repeating variables or find the positions of carriage returns for this. Just do something like: Set Variable [ $n; Value:ValueCount ( YourTable::Textfield ) ] Loop Set Variable [ $i; Value:$i + 1 ] Exit Loop If [ $i > $n ] Set Variable [ $line; Value:GetValue ( YourTable::Textfield ; $i ) ] At this point the $line variable will hold the current line and you can go to the child table, create a new record and populate the name field with the name extracted from the $line variable. I am not sure how exactly to do the extraction, since you've listed several options but did not provide any rules for distinguishing among them.
  13. That's too bad and you should definitely get them to fix it. But I am curious how it's possible that: For me, it returns an error: ? * Line 11, Column 2 Missing '}' or object member name
  14. I am glad you got it sorted. As an aside, I am not sure what exactly you're trying to accomplish here, but I suspect there is a simpler way.
  15. First, what you posted is not valid JSON. There's a comma after: "temp" : 24.47 that shouldn't be there. If we remove it, then we can see that weather is an array that contains one object. You access this object using its index number (0-based) in square brackets: weather[0] and from there you can get the value of icon using: JSONGetElement($JSON ; "weather[0].icon") -- P.S. Why does a file containing JSON have an .XML extension?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.