-
-
-
-
-
-
-
-
-
-
-
abs
-
acos
-
age
-
alert
-
appendTempFile
-
appointment
-
array
-
Array
-
asin
-
atan
-
atan2
-
avg
-
barcodeScan
-
cached
-
capitalize
-
ceil
-
chosen
-
clientLang
-
closeAllRecords
-
closeFullscreen
-
closeRecord
-
color
-
concat
-
contains
-
cos
-
count (aka cnt)
-
createCalendarEvent
-
createCalendarReminder
-
createTempFile
-
createTextFile
-
createXLSX
-
createZipFile
-
databaseId
-
date
-
datetime
-
day
-
days
-
degrees
-
dialog
-
duplicate
-
duration
-
email
-
endof
-
even
-
exp
-
extractx
-
fieldId
-
file
-
fileMetadata
-
files
-
fileUrl
-
first
-
floor
-
format
-
formatJSON
-
formatXML
-
get
-
html
-
http
-
icon
-
importFile
-
index
-
invalidate
-
isAdminMode
-
isDatabaseLocked
-
isDatabaseProtected
-
item
-
join
-
last
-
latitude
-
length
-
ln
-
loadFileAsBase64
-
loadFileAsBase64URL
-
location
-
log
-
longitude
-
lower
-
lpad
-
max
-
min
-
month
-
monthIndex
-
monthName
-
ninoxApp
-
now
-
number
-
numbers
-
odd
-
openFullscreen
-
openPage
-
openPrintLayout
-
openRecord
-
openTable
-
openURL
-
parseCSV
-
parseJSON
-
parseXML
-
phone
-
popupRecord
-
pow
-
printAndSaveRecord
-
printRecord
-
printTable
-
quarter
-
queryConnection
-
radians
-
random
-
range
-
raw
-
record
-
removeFile
-
removeItem
-
renameFile
-
replace
-
replacex
-
round
-
rpad
-
rsort
-
sendCommand
-
sendEmail
-
set
-
setItem
-
shareFile
-
shareView
-
sign
-
sin
-
sleep
-
slice
-
sort
-
split
-
splitx
-
sqr
-
sqrt
-
start
-
string
-
styled
-
substr
-
substring
-
sum
-
tableId
-
tan
-
teamId
-
testx
-
text
-
Text
-
time
-
timeinterval
-
timestamp
-
today
-
trim
-
unique
-
unshareAllViews
-
unshareFile
-
unshareView
-
upper
-
url
-
urlDecode
-
urlEncode
-
urlOf
-
user
-
userEmail
-
userFirstName
-
userFullName
-
userHasRole
-
userId
-
userIsAdmin
-
userLastName
-
userName
-
userRole
-
userRoles
-
users
-
validateXML
-
waitForSync
-
week
-
weekday
-
weekdayIndex
-
weekdayName
-
workdays
-
year
-
yearmonth
-
yearquarter
-
yearweek
-
abs
-
-
-
-
-
-
removeFile
- updated 10 mths ago
To securely remove a file from a field or record
This function removes a file by specifying either:
- A
fileobject that contains the necessary information (nidand the file name). nidand the file name as separate parameters.
The file object can either come from an Image field or be created using the file(this, "Name") function.
Caution: When using this function on native apps (iOS, iPadOS, macOS, Android), it must be enclosed in a
do as servercode block within the formula editor.
Syntax
removeFile(file, string)
removeFile(nid, string, string)
Return
void
Note: When using the
removeFilefunction on an Image field (removeFile(file)), the Image field itself is not automatically updated. This behavior is intentional.
To fully clear the file reference from an Image field, you need to manually set that Image field to null using scripting, such as:
removeFile(Image);
Image := null;
This ensures that the file is removed and the field is properly cleared.
Examples
Use removeFile(file) to remove an image attached to a record and displayed in an Image field:
removeFile(Image);
Image := null
Result: The image is removed from the record, and the Image field is set to empty.
Use removeFile(nid, fileName) to remove a PDF attached to a record:
removeFile(this, "Offer_0724.pdf")
Result: The PDF "Offer_0724.pdf" is removed from the record.
Note: You can use loops to remove multiple files in the same operation, though the process may be slow.
See also
renameFile which renames a file in a field or record.
importFile which imports a file from a URL and saves it in a record.
shareFile which returns a URL of a specific file.
